package com.gg.pojo;

import java.util.Arrays;

public class Student {
    private String[] studentName;
    private Integer age;
    private Teacher teacher;

    public void show() {
        for (String s : studentName) {
            System.out.println(s + "的年龄是" + this.age + "的任课老师是" + this.teacher.getTeacherName());
        }
    }

    public Student(String[] studentName, Integer age, Teacher teacher) {
        this.studentName = studentName;
        this.age = age;
        this.teacher = teacher;
    }

    @Override
    public String toString() {
        return "Student{" +
                "studentName=" + Arrays.toString(studentName) +
                ", age=" + age +
                ", teacher=" + teacher +
                '}';
    }

    public String[] getStudentName() {
        return studentName;
    }

    public void setStudentName(String[] studentName) {
        this.studentName = studentName;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Teacher getTeacher() {
        return teacher;
    }

    public void setTeacher(Teacher teacher) {
        this.teacher = teacher;
    }

    public Student() {
    }
}
